;;; guix-config --- additional software for a custom configuration of gnu-guix
;;; Copyright © 2020 Kolya <kolya.daemon@vfemail.net>
;;;
;;; This file is part of guix-config
;;;
;;; guix-config is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; guix-config is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
(define-module (kolyad packages vim)
  #:use-module (guix build utils)
  #:use-module (guix build-system gnu)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages vim))

(define-public tree-sitter
  (package
    (name "tree-sitter")
    (version "0.19.5")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/tree-sitter/tree-sitter.git")
               (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
          (base32 "1qmb0sva28zv6r3c3j7xs9pc8bpwwhkb9vxxndw2zbdn9wkvmbmn"))))
    (build-system gnu-build-system)
    (arguments
      `(#:tests? #f ; No check target
        #:make-flags
        (let ((out (assoc-ref %outputs "out")))
          (list (string-append "CC=" ,(cc-for-target))
                (string-append "PREFIX=" out)))
        #:phases (modify-phases %standard-phases
                   (delete 'configure))))
    (home-page "https://tree-sitter.github.io")
    (synopsis "An incremental parsing system for programming tools")
    (description "Tree-sitter is a parser generator tool and an incremental
parsing library. It can build a concrete syntax tree for a source file and
efficiently update the syntax tree as the source file is edited.")
    (license license:expat)))  ; MIT license

(define-public neovim-nightly
  (let ((commit "b585f723bcbaa10a091fce5a61659b331b1467b9")
        (revision "1429"))
    (package
      (inherit neovim)
      (name "neovim-nightly")
      (version (git-version "0.5.0" revision commit))
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/neovim/neovim")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
            (base32 "1dhzi5g5x5k53jg1cikwhz1d1ks1wafqplcaba4h88m1alrpv6v6"))))
      (inputs
        `(("tree-sitter" ,tree-sitter)
          ,@(package-inputs neovim))))))
;;; vim: set expandtab tabstop=2 shiftwidth=2
;;; end of file util.scm
